//
//  NurceViewController.m
//  必争医疗
//
//  Created by 毕成 on 14-11-20.
//  Copyright (c) 2014年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "NurceViewController.h"
#import "NurceTableViewCell.h"
#import "NurceWebViewController.h"
@interface NurceViewController ()<UITableViewDataSource,UITableViewDelegate>

@end

@implementation NurceViewController

- (void)dealloc
{
    [_tableArray release];
    [_table release];
    [super dealloc];
}

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.tableArray = [NSMutableArray array];
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self.view setBackgroundColor:[UIColor whiteColor]];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"left.png"] style:UIBarButtonItemStyleDone target:self action:@selector(leftAction:)];
    [self.tabBarController.tabBar setHidden:YES];
    
    self.navigationController.navigationBar.translucent = NO;
    [self.navigationItem setTitle:@"春雨美小护"];
    
    [self creatTable];
    
}

- (void)leftAction:(id)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)creatTable
{
    self.table = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height - 64) style:UITableViewStylePlain];
    _table.dataSource = self;
    _table.delegate = self;
    [_table setBackgroundColor:[UIColor blueColor]];
    [_table setRowHeight:300];
    [self.view addSubview:_table];
    [self.table release];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    
    return 3;
   // return [_tableArray count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *str = @"nurce";
    NurceTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:str];
    if (!cell) {
        cell = [[NurceTableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:str];
    }
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    NurceWebViewController *web = [[NurceWebViewController alloc] init];
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    [self.navigationController pushViewController:web animated:YES];
}










- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
